package com.example.注解和反射.reflection;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

public class Test01 {
    public static void main(String[] args) throws ClassNotFoundException {
        Class c1 = Class.forName("com.example.注解和反射.reflection.User");
        System.out.println(c1);

        Class c2 = Class.forName("com.example.注解和反射.reflection.User");
        Class c3 = Class.forName("com.example.注解和反射.reflection.User");
        Class c4 = Class.forName("com.example.注解和反射.reflection.User");

        //一个类在内存中只有一个Class对象
        //一个类被加载后，类的整个结构都会被封装在class对象中
        System.out.println(c2.hashCode());
        System.out.println(c3.hashCode());
        System.out.println(c4.hashCode());

    }
}

@Data
@AllArgsConstructor
@NoArgsConstructor
class User{
    private Integer id;
    private String name;
    private String password;

}
